﻿@model IEnumerable<PilotProject.Question>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
@*  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>*@

   <script type="text/javascript" src="../../Scripts/jquery.unobtrusive-ajax.min.js"></script>
   <script type="text/javascript">
       function dosmth() {
           $("#filterData").val($("select#filter").val());       
      }
   </script>



<div id="combo">
   <p> Filter by selecting from dropdown below</p>
   
 @using (Ajax.BeginForm(new AjaxOptions 
         { InsertionMode = InsertionMode.Replace, UpdateTargetId = "myGrid" }))
     {

        <select id="filter" name="filter" onchange="dosmth()">
        <option value="0">All </option>
        <option value="Pilot Active">Pilot Active</option>   
        <option value="Packer Active">Packer Active</option>
        <option value="Pilot Inactive">Pilot Inactive</option>
        <option value="Packer Inactive">Packer Inactive</option>
        </select>
     
        @Html.Hidden("filterData")
        <input type="submit" id="filterData"  value="Search" class="filterButton"/>

     }

    <span style="margin-top:15px;margin-left:20px;"><p>@Html.ActionLink("Create New Question", "Create")</p></span>

</div>


<div id="myGrid" style="margin-top:20px;">
     @Html.Partial("_grid", @Model)
</div>



